|
|
|
| |
Deploying EJBs in the EJB 2.0 Container
Automatic Deployment Directory
Deploying compiled EJB .jar files
Deploying uncompiled EJB .jar files
Deploying from an EJB .jar directory
Configuring Automatic Deployment
The EJB 2.0 for BEA WebLogic Server container provides simplified methods for deploying and redeploying EJBs. This section describes how to deploy EJBs into the EJB 2.0 container.
Note that you can continue to deploy EJB 1.1 beans into the EJB 1.1 container by using the instructions in Deploying EJBs in WebLogic Server. You should also become familiar with these EJB 1.1 instructions before attempting to deploy EJB 2.0 beans.
Automatic Deployment Directory
The new $WL_HOME/ejb_deployments directory acts as an automatic deployment directory for EJB 2.0 .jar files and EJB .jar deployment directories. When you start WebLogic Server, it automatically deploys any valid EJB 2.0 .jar files or .jar directories that reside in ejb_deployments.
WebLogic Server also checks the contents of ejb_deployments every ten seconds to determine if an EJB deployment has changed. If a deployment has changed, it is automatically redeployed using the hot deployment feature described in Deploying EJBs in a running WebLogic Server (Hot Deployment). (You can also change the interval at which WebLogic Server checks the deployment directory using the instructions in Configuring Automatic Deployment).
See the sections below for more information on deploying and redeploying compiled .jar files, uncompiled .jar files, and .jar directories using the ejb_deployments directory.
Note: WebLogic Server also uses a new $WL_HOME/tmp_deployments directory to copy EJB .jar files before deploying them into the EJB 2.0 container. Do not add, remove, or modify files in tmp_deployments.
Deploying compiled EJB .jar files
You create compiled EJB 2.0 .jar files by:
These steps are similar to the steps required for EJB 1.1 beans. See Required steps for deploying EJBs for more information.
You may already have compiled .jar files that you used for deploying EJBs to the container in WebLogic Server Version 5.1 EJB 1.1 container. To deploy these files to the new container, simply:
Note: The Beta container does not support deploying EJB 1.1-compliant CMP entity beans into the EJB 2.0 container. If you have EJB 1.1-compliant CMP beans, you must deploy them into the EJB 1.1 container. Follow the steps in Required steps for deploying EJBs.
If you change the contents of a compiled EJB .jar file in ejb_deployments (by repackaging, recompiling, or copying over the existing .jar file), WebLogic Server automatically attempts to redeploy the .jar using the hot deployment feature.
Note: Because the automatic redeployment feature uses hot deployment, WebLogic Server can only redeploy an EJB's implementation classes. You cannot redeploy an EJB's public interfaces, as described in Hotdeploy concepts and restrictions.
Deploying uncompiled EJB .jar files
The new WebLogic Server container also enables you to automatically deploy .jar files that contain uncompiled EJB classes and interfaces. An uncompiled ejb .jar file has the same structure as a compiled file, with the following exceptions:
The .java or .class files in the .jar file must still be packaged in subdirectories that match their Java package hierarchy. Also, as with all EJB .jar files, you must include the appropriate XML deployment files in a top-level META-INF directory.
Once you have packaged the uncompiled classes, simply copy the .jar into the ejb_deployments directory. If necessary, WebLogic Server automatically runs javac (or a compiler you specify) to compile the .java files, and runs weblogic.ejbc20 to generate container classes. The compiled classes are copied into a new .jar file in $WL_HOME/tmp_deployments, and deployed to the EJB container.
Should you ever modify an uncompiled .jar in $WL_HOME/ejb_deployments (either by repackaging or copying over the .jar file), WebLogic Server automatically recompiles and redeploys the .jar using the same steps.
Note: Because the automatic redeployment feature uses hot deployment, WebLogic Server can only redeploy an EJB's implementation classes. You cannot redeploy an EJB's public interfaces, as described in Hotdeploy concepts and restrictions.
Deploying from an EJB .jar directory
The EJB 2.0 container also enables you to deploy EJBs using an EJB .jar subdirectory in $WL_HOME/ejb_deployments. Using this method is similar to using an uncompiled .jar file, in that you do not need to compile EJB classes and interfaces, and you do not need to run weblogic.ejbc20. Using a .jar subdirectory also removes the requirement for packaging the EJB deployment into a .jar file - you simply create a subdirectory in ejb_deployments that has the same structure of an EJB .jar file.
For example, the following files define a valid EJB .jar deployment directory for use with the WebLogic Server EJB 2.0 container:
When you use an EJB .jar directory in this manner, WebLogic Server automatically redeploys the EJB when the ejb-jar.xml deployment file has changed. If you are developing a new EJB using a .jar directory, you can trigger redeployment by changing the timestamp of ejb-jar.xml (on UNIX systems, use the touch command; on Windows NT, open and save the file in a text editor).
Configuring Automatic Deployment
You can control the following aspects of automatic redeployment by configuring the associated startup class arguments in weblogic.properties:
See Configuring and Starting WebLogic Server for more information about setting these startup arguments.
|
|
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|